package com.lcf.controller;

import com.github.pagehelper.PageInfo;
import com.lcf.entity.User;
import com.lcf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/page")
    public PageInfo<User> page(int pageNum, int pageSize) {
        PageInfo<User> allUserByPage = userService.findAllUserByPage(pageNum, pageSize);

        return allUserByPage;
    }

    @GetMapping("/index")
    public String index() {

        return "aa";
    }
}
